﻿<UserControl x:Class="ProgrammersCalculator.View.TextEncoding"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:conv="clr-namespace:ProgrammersCalculator.Convertor"
             mc:Ignorable="d">
    <UserControl.Resources>
        <conv:BaseEncoder x:Key="myConvert"></conv:BaseEncoder>
    </UserControl.Resources>
    <DockPanel>
        <Border DockPanel.Dock="Top"
                Style="{DynamicResource styleContentArea}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <!-- HEADER -->
                <Border Grid.Row="0"
                        Style="{DynamicResource styleContentAreaHeader}">
                    <Grid>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="20"
                                       Padding="8"
                                       VerticalAlignment="Center">String Encoding</TextBlock>
                        </StackPanel>
                    </Grid>
                </Border>

                <!--CONTENT AREA-->
                <Grid x:Name="LayoutRoot"
                      Grid.Row="1">
                    <StackPanel x:Name="ContentStackPanel">
                        <StackPanel Margin="0">
                            <Expander Header="String to Base64"
                                      FontFamily="Verdana"
                                      IsExpanded="True">
                                <StackPanel Margin="10,4,0,0">
                                    <TextBlock Text="Enter Base64 String"></TextBlock>
                                    <TextBox TextWrapping="Wrap"
                                             VerticalAlignment="Top"
                                             VerticalScrollBarVisibility="Visible"
                                             AcceptsReturn="True"
                                             Name="textBox" />
                                    <Border CornerRadius="10"
                                            Background="#FFF9F7F7"
                                            Height="5"></Border>
                                    <TextBox TextWrapping="Wrap"
                                             VerticalScrollBarVisibility="Auto"
                                             Text="{Binding ElementName=textBox,Path=Text,Converter={StaticResource myConvert},ConverterParameter=e}"
                                             AcceptsReturn="True"
                                             Name="txtBase64"
                                             Height="100"
                                             CaretIndex="1" />
                                </StackPanel>
                            </Expander>
                            <Expander Header="Base64 to String"
                                      IsExpanded="False"
                                      FontFamily="Verdana">
                                <StackPanel Margin="10,4,0,0">
                                    <TextBlock Text="Enter Base64 String"></TextBlock>
                                    <TextBox TextWrapping="Wrap"
                                             VerticalScrollBarVisibility="Auto"
                                             AcceptsReturn="True"
                                             Name="txtBoxBase64"
                                             Height="100"
                                             CaretIndex="1" />
                                    <TextBox TextWrapping="Wrap"
                                             VerticalScrollBarVisibility="Auto"
                                             Text="{Binding ElementName=txtBoxBase64,Path=Text,Converter={StaticResource myConvert},ConverterParameter=d}"
                                             AcceptsReturn="True"
                                             Name="txtString"
                                             Height="100"
                                             CaretIndex="1" />
                                </StackPanel>
                            </Expander>
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </DockPanel>
</UserControl>
